package main

import "fmt"

func main() {
	c := make(chan int)

	go func() {
		defer fmt.Println("sub goroutine end")
		fmt.Println("sub goroutine正在执行")
		c <- 1 // 表示把value写入管道c

	}()
	fmt.Println("main 正在执行")
	mainNum := <-c
	fmt.Println("c=", mainNum)
	fmt.Println("main goroutine is end")
}
